package org.clazz.man.controller;

import org.clazz.man.entity.Msg;
import org.clazz.man.util.UserUtil;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class LoginController {
    @RequestMapping("/")
    public String index(Model model) {
        String userName = UserUtil.getUserName();
        model.addAttribute("userName", userName);

        Msg msg = new Msg("测试标题", "测试内容", "额外信息，只对管理员显示");
        model.addAttribute("msg", msg);
        return "index";
    }

    @RequestMapping("/index")
    public String indexPge(Model model) {
        return index(model);
    }
}